package com.example.demo.service;

import com.example.demo.entity.CommentInfo;
import com.example.demo.mapper.CommentMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2023-09-15
 * Time:21:49
 */
@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;

    /**
     * 添加评论
     */
    public Integer add(CommentInfo commentInfo){
        return commentMapper.add(commentInfo);
    }

    /**
     * 获取所有评论
     */
    public List<CommentInfo> showComment(Integer aid){
        return commentMapper.showComment(aid);
    }

//    /**
//     * 得到评论信息通过id
//     */
//    public CommentInfo getCommonentById(Integer id){
//        return commentMapper.getCommonentById(id);
//    }

    /**
     * 设置评论用户头像
     */
    public Integer setUserPhoto(Integer id,String photo){
        return commentMapper.setUserPhoto(id,photo);
    }
}
